# !/usr/bin/env python
__author__ = 'kenzhaoyihui'

import socket
import time

"""
target_host = "www.google.com"
target_port = 80

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((target_host, target_port))
client.send("Get / HTTP/1.1\r\nHost: google.com\r\n\r\n")

response = client.recv(4096)
print response
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 9998))
while True:
	s.send("Hello I am client!")
	print s.recv(1024)
	time.sleep(2)